Check args for NULL. (gtk_selection_default_handler): Replace manual list
authorJeff Garzik <jgarzik@pobox.com>
Thu, 21 Jan 1999 22:29:58 +0000 (22:29 +0000)
committerJeff Garzik <jgarzik@src.gnome.org>
Thu, 21 Jan 1999 22:29:58 +0000 (22:29 +0000)
Thu Jan 21 17:13:12 1999  Jeff Garzik  <jgarzik@pobox.com>

        * gtk/gtkselection.c:
        (gtk_selection_property_notify): Check args for NULL.
        (gtk_selection_default_handler):
        Replace manual list count with call to g_list_length.
        Remove signedness of temp var 'count' to agree with usage.
        Slight spacing adjustment for readability.

        * gtk/gtkbox.c, gtk/gtklayout.c, gtk/gtkselection.c:
        Init a few ptrs to NULL, to quiet warnings.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkbox.c
gtk/gtklayout.c
gtk/gtkselection.c

index 521055bb6d39cb440cffe626fc1ce4f31bb9f239..5efcce60416624c360de3b66c2a7f08e128207bb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Thu Jan 21 17:13:12 1999  Jeff Garzik  <jgarzik@pobox.com>
+
+       * gtk/gtkselection.c:
+       (gtk_selection_property_notify): Check args for NULL.
+       (gtk_selection_default_handler):
+       Replace manual list count with call to g_list_length.
+       Remove signedness of temp var 'count' to agree with usage.
+       Slight spacing adjustment for readability.
+
+       * gtk/gtkbox.c, gtk/gtklayout.c, gtk/gtkselection.c:
+       Init a few ptrs to NULL, to quiet warnings.
+
 Thu Jan 21 16:03:02 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
index 521055bb6d39cb440cffe626fc1ce4f31bb9f239..5efcce60416624c360de3b66c2a7f08e128207bb 100644 (file)
@@ -1,3 +1,15 @@
+Thu Jan 21 17:13:12 1999  Jeff Garzik  <jgarzik@pobox.com>
+
+       * gtk/gtkselection.c:
+       (gtk_selection_property_notify): Check args for NULL.
+       (gtk_selection_default_handler):
+       Replace manual list count with call to g_list_length.
+       Remove signedness of temp var 'count' to agree with usage.
+       Slight spacing adjustment for readability.
+
+       * gtk/gtkbox.c, gtk/gtklayout.c, gtk/gtkselection.c:
+       Init a few ptrs to NULL, to quiet warnings.
+
 Thu Jan 21 16:03:02 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
index 521055bb6d39cb440cffe626fc1ce4f31bb9f239..5efcce60416624c360de3b66c2a7f08e128207bb 100644 (file)
@@ -1,3 +1,15 @@
+Thu Jan 21 17:13:12 1999  Jeff Garzik  <jgarzik@pobox.com>
+
+       * gtk/gtkselection.c:
+       (gtk_selection_property_notify): Check args for NULL.
+       (gtk_selection_default_handler):
+       Replace manual list count with call to g_list_length.
+       Remove signedness of temp var 'count' to agree with usage.
+       Slight spacing adjustment for readability.
+
+       * gtk/gtkbox.c, gtk/gtklayout.c, gtk/gtkselection.c:
+       Init a few ptrs to NULL, to quiet warnings.
+
 Thu Jan 21 16:03:02 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
index 521055bb6d39cb440cffe626fc1ce4f31bb9f239..5efcce60416624c360de3b66c2a7f08e128207bb 100644 (file)
@@ -1,3 +1,15 @@
+Thu Jan 21 17:13:12 1999  Jeff Garzik  <jgarzik@pobox.com>
+
+       * gtk/gtkselection.c:
+       (gtk_selection_property_notify): Check args for NULL.
+       (gtk_selection_default_handler):
+       Replace manual list count with call to g_list_length.
+       Remove signedness of temp var 'count' to agree with usage.
+       Slight spacing adjustment for readability.
+
+       * gtk/gtkbox.c, gtk/gtklayout.c, gtk/gtkselection.c:
+       Init a few ptrs to NULL, to quiet warnings.
+
 Thu Jan 21 16:03:02 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
index 521055bb6d39cb440cffe626fc1ce4f31bb9f239..5efcce60416624c360de3b66c2a7f08e128207bb 100644 (file)
@@ -1,3 +1,15 @@
+Thu Jan 21 17:13:12 1999  Jeff Garzik  <jgarzik@pobox.com>
+
+       * gtk/gtkselection.c:
+       (gtk_selection_property_notify): Check args for NULL.
+       (gtk_selection_default_handler):
+       Replace manual list count with call to g_list_length.
+       Remove signedness of temp var 'count' to agree with usage.
+       Slight spacing adjustment for readability.
+
+       * gtk/gtkbox.c, gtk/gtklayout.c, gtk/gtkselection.c:
+       Init a few ptrs to NULL, to quiet warnings.
+
 Thu Jan 21 16:03:02 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
index 521055bb6d39cb440cffe626fc1ce4f31bb9f239..5efcce60416624c360de3b66c2a7f08e128207bb 100644 (file)
@@ -1,3 +1,15 @@
+Thu Jan 21 17:13:12 1999  Jeff Garzik  <jgarzik@pobox.com>
+
+       * gtk/gtkselection.c:
+       (gtk_selection_property_notify): Check args for NULL.
+       (gtk_selection_default_handler):
+       Replace manual list count with call to g_list_length.
+       Remove signedness of temp var 'count' to agree with usage.
+       Slight spacing adjustment for readability.
+
+       * gtk/gtkbox.c, gtk/gtklayout.c, gtk/gtkselection.c:
+       Init a few ptrs to NULL, to quiet warnings.
+
 Thu Jan 21 16:03:02 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
index 521055bb6d39cb440cffe626fc1ce4f31bb9f239..5efcce60416624c360de3b66c2a7f08e128207bb 100644 (file)
@@ -1,3 +1,15 @@
+Thu Jan 21 17:13:12 1999  Jeff Garzik  <jgarzik@pobox.com>
+
+       * gtk/gtkselection.c:
+       (gtk_selection_property_notify): Check args for NULL.
+       (gtk_selection_default_handler):
+       Replace manual list count with call to g_list_length.
+       Remove signedness of temp var 'count' to agree with usage.
+       Slight spacing adjustment for readability.
+
+       * gtk/gtkbox.c, gtk/gtklayout.c, gtk/gtkselection.c:
+       Init a few ptrs to NULL, to quiet warnings.
+
 Thu Jan 21 16:03:02 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkbutton.c (gtk_button_expose): Code cleanup.
index 77a5ce4e6e25790e2d7016ed5d5a1222c7b134b5..6170d41b86516b9c4617b5cd0ed41ee0a98d40e1 100644 (file)
@@ -511,7 +511,7 @@ gtk_box_query_child_packing (GtkBox             *box,
                             GtkPackType        *pack_type)
 {
   GList *list;
-  GtkBoxChild *child_info;
+  GtkBoxChild *child_info = NULL;
 
   g_return_if_fail (box != NULL);
   g_return_if_fail (GTK_IS_BOX (box));
@@ -549,7 +549,7 @@ gtk_box_set_child_packing (GtkBox               *box,
                           GtkPackType           pack_type)
 {
   GList *list;
-  GtkBoxChild *child_info;
+  GtkBoxChild *child_info = NULL;
 
   g_return_if_fail (box != NULL);
   g_return_if_fail (GTK_IS_BOX (box));
index 6e7181bc37250bafb392b9760759c2ca1de7d02b..e9c90ebd4c289c033b3da6a73d09512876e83254 100644 (file)
@@ -630,7 +630,7 @@ gtk_layout_remove (GtkContainer *container,
 {
   GList *tmp_list;
   GtkLayout *layout;
-  GtkLayoutChild *child;
+  GtkLayoutChild *child = NULL;
   
   g_return_if_fail (container != NULL);
   g_return_if_fail (GTK_IS_LAYOUT (container));
index 964fd5c12f982e279d20d6353f23ea83287a5462..f61ec6f59070ef13d2301ba8c3198277c9d13346 100644 (file)
@@ -293,7 +293,7 @@ gtk_selection_owner_set (GtkWidget *widget,
 {
   GList *tmp_list;
   GtkWidget *old_owner;
-  GtkSelectionInfo *selection_info;
+  GtkSelectionInfo *selection_info = NULL;
   GdkWindow *window;
   
   if (widget == NULL)
@@ -739,7 +739,7 @@ gtk_selection_clear (GtkWidget *widget,
      somewhat unreliable. */
   
   GList *tmp_list;
-  GtkSelectionInfo *selection_info;
+  GtkSelectionInfo *selection_info = NULL;
   
   tmp_list = current_selections;
   while (tmp_list)
@@ -983,7 +983,7 @@ gtk_selection_incr_event (GdkWindow    *window,
                          GdkEventProperty *event)
 {
   GList *tmp_list;
-  GtkIncrInfo *info;
+  GtkIncrInfo *info = NULL;
   gint num_bytes;
   guchar *buffer;
   
@@ -1154,7 +1154,7 @@ gtk_selection_notify (GtkWidget          *widget,
                      GdkEventSelection *event)
 {
   GList *tmp_list;
-  GtkRetrievalInfo *info;
+  GtkRetrievalInfo *info = NULL;
   guchar  *buffer;
   gint length;
   GdkAtom type;
@@ -1240,12 +1240,15 @@ gtk_selection_property_notify (GtkWidget        *widget,
                               GdkEventProperty *event)
 {
   GList *tmp_list;
-  GtkRetrievalInfo *info;
+  GtkRetrievalInfo *info = NULL;
   guchar *new_buffer;
   int length;
   GdkAtom type;
   gint   format;
   
+  g_return_val_if_fail (widget != NULL, FALSE);
+  g_return_val_if_fail (event != NULL, FALSE);
+
   if ((event->state != GDK_PROPERTY_NEW_VALUE) ||  /* property was deleted */
       (event->atom != gdk_selection_property)) /* not the right property */
     return FALSE;
@@ -1493,24 +1496,18 @@ gtk_selection_default_handler (GtkWidget        *widget,
     {
       /* List of all targets supported for this widget/selection pair */
       GdkAtom *p;
-      gint count;
+      guint count;
       GList *tmp_list;
       GtkTargetList *target_list;
       GtkTargetPair *pair;
       
-      count = 3;
       target_list = gtk_selection_target_list_get (widget,
                                                   data->selection);
-      tmp_list = target_list->list;
-      while (tmp_list)
-       {
-         count++;
-         tmp_list = tmp_list->next;
-       }
+      count = g_list_length (target_list->list) + 3;
       
       data->type = GDK_SELECTION_TYPE_ATOM;
       data->format = 8*sizeof (GdkAtom);
-      data->length = count*sizeof (GdkAtom);
+      data->length = count * sizeof (GdkAtom);
       
       p = g_new (GdkAtom, count);
       data->data = (guchar *)p;